<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 86135
  Date: 2021/5/10
  Time: 8:09
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>


<!DOCTYPE html>
<html>

<head>
    <style type="text/css">

    body{
        background-color: #7ecff4;
    }
    td{
        border: 1px solid white;
        font-size: 20px;

    }
    table{
        position: absolute;
        left: 10px;
    }
    .selectForm{

        padding-left: 200px;
        font-size: 30px;
        /*border: 1px solid red;*/
        height: 500px;
        width: 50%;
        /*background-color:#eae9e9;*/
        margin-left: 250px;
    }
    .selectForm-submit{
        background-color: orangered;
        width: 100px;
        height: 30px;
        font-size: 20px;
        color: white;
        margin-left: 100px;
    }
    .selectForm input{
        text-align:center;
        line-height:30px;
    }
    h2{
        text-align:center;
    }
</style>
    <meta charset="utf-8">
    <title>Layui</title>
    <%
        //获取项目的根路径
        String path = request.getContextPath();
        String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="<%=basePath%>/layui/css/layui.css"  media="all">
    <script src="<%=basePath%>/layui/layui.js" charset="utf-8"></script>
    <link rel="shortcut icon" href="#"/>
    <script type="text/javascript" src="<%=basePath%>/jquery-1.12.4.js"></script>
</head>
<body>
<%--<div class="layui-layout layui-layout-admin">--%>
<%--    <div class="layui-header">--%>
<%--        <div class="layui-logo">华子图书馆</div>--%>
<%--        <!-- 头部区域（可配合layui 已有的水平导航） -->--%>
<%--        <ul class="layui-nav layui-layout-right">--%>
<%--            <li class="layui-nav-item">--%>
<%--                <a href="javascript:;">--%>
<%--                    <img src="//tva1.sinaimg.cn/crop.0.0.118.118.180/5db11ff4gw1e77d3nqrv8j203b03cweg.jpg" class="layui-nav-img">--%>
<%--                    ${requestScope.deng}--%>
<%--                </a>--%>
<%--                <dl class="layui-nav-child">--%>

<%--                    <dd><a href="<%=basePath%>/LibaryServlet?password=${requestScope.password}&deng=${requestScope.deng}&Uppad=mima">修改密码</a></dd>--%>
<%--                </dl>--%>
<%--            </li>--%>
<%--            <li class="layui-nav-item"><a href="">个人信息</a></li>--%>
<%--        </ul>--%>
<%--    </div>--%>

<%--    <div class="layui-side layui-bg-black">--%>
<%--        <div class="layui-side-scroll">--%>
<%--            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->--%>
<%--            <ul class="layui-nav layui-nav-tree"  lay-filter="test">--%>
<%--                <li class="layui-nav-item layui-nav-itemed">--%>
<%--                    <a class="" href="javascript:;">书籍信息</a>--%>
<%--                </li>--%>
<%--                <li class="layui-nav-item"><a href="<%=basePath%>/tushug/Insertss.jsp" target="mainFrame">书籍入库</a></li>--%>
<%--                <li class="layui-nav-item"><a href="javascript:;">失物招领</a></li>--%>
<%--                <li class="layui-nav-item"><a href="javascript:;">借书登记</a></li>--%>
<%--                <li class="layui-nav-item"><a href="javascript:;">逾期记录</a></li>--%>
<%--            </ul>--%>
<%--        </div>--%>
<%--    </div>--%>

<%--    <div class="layui-body">--%>
        <!-- 内容主体区域 -->
        <div style="padding: 15px;">
<%--            查询表单--%>
            <div class="selectForm">
            <form action="<%=basePath%>/LibaryServlet?denglu=${requestScope.deng}">
            书名:<input type="text" name="bookname" id="bookName"><br>
            作者:<input type="text" name="author" id="zuozhe"><br>
            <input name="submit" type="submit" class="selectForm-submit" value="提交">
            <input type="button" value="重置" id="chongzhi" class="selectForm-submit">
                <table class="layui-table" lay-even="" lay-skin="nob">
                    <colgroup>
                        <col width="150">
                        <col width="150">
                        <col width="200">
                        <col>
                    </colgroup>
                    <thead>
                    <tr>
                        <td>编号</td>
                        <td>书名</td>
                        <td>书籍分类</td>
                        <td>作者</td>
                        <td>库存</td>
                        <td>价格</td>
                        <td>书籍位置</td>
                        <td>书籍来源</td>
                        <td>加入时间</td>
                        <td>操作</td>
                    </tr>
                    </thead>
                    <tbody>
                    <c:forEach items="${bays.list}" var="li">
                    <tr>
                        <td>${li.id}</td>
                        <td>${li.bookName}</td>
                        <td>${li.typeName}</td>
                        <td>${li.author}</td>
                        <td>${li.sum}</td>
                        <td>${li.price}</td>
                        <td>${li.location}</td>
                        <td>${li.source}</td>
                        <td>${li.jdate}</td>
                        <td><a href="<%=basePath%>/LibaryServlet?id=${li.id}&delete=delete" id="shanchu">删除</a>
                            <a href="<%=basePath%>/LibaryServlet?id=${li.id}&bookName=${li.bookName}&typeName=${li.typeName}&author=${li.author}&sum=${li.sum}&price=${li.price}&location=${li.location}&source=${li.source}&jdate=${li.jdate}&up=update">修改</a>
                        </td>
                    </tr>
                    </c:forEach>
                    <c:if test="${requestScope.bays.currentPage>1}">
                    <a href="<%=basePath%>/LibaryServlet?currentPage=${requestScope.bays.currentPage-1}">上一页</a>
                    </c:if>
                    <c:if test="${requestScope.bays.currentPage<requestScope.bays.totalPage}">
                    <a href="<%=basePath%>/LibaryServlet?currentPage=${requestScope.bays.currentPage+1}">下一页</a>
                    </c:if>
                </table>
            </form>
            </div>
        </div>
<%--    </div>--%>
<%--    <div class="layui-footer">--%>
<%--        <!-- 底部固定区域 -->--%>
<%--       <h2>华子图书馆</h2>--%>
<%--    </div>--%>
<%--</div>--%>

<script type="text/javascript">
    $(function () {
        $("#chongzhi").click(function (){
            $("#bookName").val("");
            $("#zuozhe").val("");
        })

    })

</script>
</body>
</html>
